Attribute exists at the source of a link?

Hello All

Does anyone know a way to use 'attribute exists "attributename"' to find out if the attribute exists in the module at the source of a link please?

Many thanks
Roobroo - Mon May 17 11:12:03 EDT 2010

Re: Attribute exists at the source of a link?
Ben_Sharples - Mon May 17 11:45:52 EDT 2010

You would need to use the link to get a handle on the module name and then use that to get a handle on the module.
 

for lref in o <- "*" do {
      strModule = fullName source(lref)
      sourceModule = read(strModule, false
}

 


you can then use

 

 

 

(current ModuleRef__) = sourceModule  // where sourceModule is of Module type



ModuleRef__ tells DXl that the activie module it should reference is sourceModule - it's an undocumented function

then use the same code to switch back to the original module. I normally define a Module handle of cuurentModule for my base module in the global variables



 

 

Re: Attribute exists at the source of a link?
llandale - Mon May 17 13:11:27 EDT 2010

You probably just want to use this:

AttrDef find(Module m, string attributeName)

So get a Module handle on that other module, find the attr, and check if the AttrDef is null.

  • Louie

Re: Attribute exists at the source of a link?
Roobroo - Tue May 18 06:01:02 EDT 2010

Thank you to you both for your help, very grateful. Just the job, thanks again.